package org.sxp.common.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author shenxingping
 * @date 2021/02/04
 */
public class XPUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
    private Logger log = LoggerFactory.getLogger(XPUncaughtExceptionHandler.class);

    @Override
    public void uncaughtException(Thread t, Throwable e) {
        this.log.error("捕获到异常 : 线程名[" + t.getName() + "], 异常名[" + e + "]");
        e.printStackTrace();
    }
}
